#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
const int maxn=32000;
int pi[5000],v[3405][14];
double f[maxn];
bool flag[maxn];
char vis[1865][maxn];
int m,cnt,n;
void init()
{
	cnt=0;
	memset(flag,0,sizeof(flag));
	for(int i=2;i<maxn;i++)
		if(!flag[i])
		{
			cnt++;
			pi[cnt]=i;
			for(int j=i;j<maxn;j+=i)
				flag[j]=1;
		}
	cnt++;pi[cnt]=0x7fffffff;
	v[0][0]=1;v[0][1]=1;
	for(int i=1;pi[i]<maxn/2;i++)
	{
		int a=pi[i];
		v[i][0]=0;
		while(a<maxn/2)
		{
			v[i][0]++;
			v[i][v[i][0]]=a;
			a*=pi[i];
		}
	}
	for(int i=0;i<maxn;i++)f[i]=1;
}
int main()
{
	int N,m=1863;
	init();
	scanf("%d",&n);
	N=n;
	if(n%2==0){printf("%d %d\n",n/2,n/2);return 0;}
	for(int i=1;pi[i]*pi[i]<=n;i++)
	{
		if(n%pi[i]==0){N=pi[i];break;}
	}
	if(N==3){printf("%d %d\n",n/3,n/3*2);return 0;}
	for(int k=1;k<=m;k++)
		for(int j=N;j>=0;j--)
			for(int i=1;i<=v[k][0]&&j>=v[k][i];i++)
				if(f[j-v[k][i]]*v[k][i]>=f[j])
				{
					f[j]=f[j-v[k][i]]*v[k][i];
					vis[k][j]=i;
				}
	int rest=n/N,i,j;
	bool ff=true;
	for(i=m,j=N;i>=1&&j>=0;i--)
	{
		if(vis[i][j])
		{
			int t=v[i][vis[i][j]];
			if(ff){printf("%d",t*rest);ff=false;}
			else printf(" %d",t*rest);
			j-=t;
		}
	}
	for(i=1;i<=j;i++)printf(" %d",rest);
	printf("\n");
	//printf("f[N]=%lf\n",f[N]);}
	return 0;
}
